
package DataAcess;

import java.util.TreeSet;


/*
 * Class ID	: SE715
 * Student ID	: 02967
 * Student Name : Vu Ngoc Trung
 * Due Date     : Jul 25, 2013
 * I declare that this assignment is my own work in accordance with FPT Policy.
 */
public class linkedBus implements Comparable{
    int xe1;
    String diemxuong;
    int xe2;

    public linkedBus(int xe1, String diemxuong, int xe2) {
        this.xe1 = xe1;
        this.diemxuong = diemxuong;
        this.xe2 = xe2;
    }

    public int getXe1() {
        return xe1;
    }

    public void setXe1(int xe1) {
        this.xe1 = xe1;
    }

    public String getDiemxuong() {
        return diemxuong;
    }

    public void setDiemxuong(String diemxuong) {
        this.diemxuong = diemxuong;
    }

    public int getXe2() {
        return xe2;
    }

    public void setXe2(int xe2) {
        this.xe2 = xe2;
    }

    @Override
    public String toString(){
        return (String.valueOf(xe1)+diemxuong.trim());
    }
    public String toPrint(){
        return (String.valueOf(xe1)+diemxuong.trim()+String.valueOf(xe2));
    }
    @Override
    public int compareTo(Object o) {
        return this.toString().compareTo(o.toString());
    }
//    public static void main(String[] args) {
//        linkedBus bus = new linkedBus(3, "hehe", 4);
//        linkedBus bus1 = new linkedBus(3, "  hehe ", 4);
//        TreeSet set = new TreeSet();
//        set.add(bus);
//        set.add(bus1);
//        System.out.println(set.size());
//    }
    
    
     //return (String.valueOf(this.xe1)+this.diemxuong.trim()).compareTo(String.valueOf(o.xe1)+o.diemxuong.trim());
    
}
